package com.safety51.bootstrap.demo.domain.student;

import com.safety51.bootstrap.demo.domain.student.entity.Parent;
import com.safety51.bootstrap.demo.domain.student.entity.Student;
import com.safety51.bootstrap.demo.domain.student.entity.Teacher;
import com.safety51.bootstrap.demo.infrastructure.mapper.one.StudentMapper;
import com.safety51.bootstrap.demo.infrastructure.mapper.three.ParentMapper;
import com.safety51.bootstrap.demo.infrastructure.mapper.two.TeacherMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by liuyuancheng on 2021/9/6  <br/>
 *
 * @author liuyuancheng
 */
@Service
public class TkMapperService {

    @Autowired
    private StudentMapper studentMapper;

    @Autowired
    private TeacherMapper teacherMapper;

    @Autowired
    private ParentMapper parentMapper;

    /**
     * 从DataSourceOne 查询数据
     *
     * @return
     */
    public List<Student> selectAllStudent(){
        return studentMapper.selectAll();
    }

    /**
     * 从DataSourceTwo查询数据
     * @return
     */
    public List<Teacher> selectAllTeacher(){
        return teacherMapper.selectAll();
    }

    public List<Parent> selectAllParent(){
        return parentMapper.selectAll();
    }

    public Student addNewStudent(){
        return null;
    }
}
